#ifndef _TASK_H_
#define _TASK_H_
#include "stm32l0xx_hal.h"
#include "stm32l0xx_nucleo.h"
#include "error.h"
#include "sensor_service.h"

#define TASK_3AXIS       0x0001
#define TASK_TEMP_HUMI   0x0002
#define TASK_BLE         0x0004

#define TASK_MASK     0xFFFF

#define BLE_LAST_TIME    60 * 60  //30min

typedef struct {
    void (*begin)(void);
    uint8_t (*process)(void);
    void    (*end)(void);
} task_plugin_t;

void call_tasks(void);
void update_schedule_time(void);
#endif //_TASK_H_
